package com.sikaryofficial.dataindicator.domain.mapping;

import com.sikaryofficial.dataindicator.domain.dto.resp.UserBehaviorDataResponse;
import com.sikaryofficial.dataindicator.domain.entity.UserBehaviorData;
import com.sikaryofficial.dataindicator.domain.eo.UserBehaviorEO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface UserBehaviorMapping {

    UserBehaviorMapping INSTANCE = Mappers.getMapper(UserBehaviorMapping.class);

    @Mapping(target = "rpTime",
            expression = "java( new java.util.Date( userBehaviorData.getRpTime()) )")
    UserBehaviorDataResponse convertToResponse(UserBehaviorData userBehaviorData);
    List<UserBehaviorDataResponse> convertToResponseList(List<UserBehaviorData> userBehaviorDatas);

    UserBehaviorEO convertToEO(UserBehaviorDataResponse userBehaviorDataResponse);
    List<UserBehaviorEO> convertToEOList(List<UserBehaviorDataResponse> userBehaviorDataResponses);
}
